home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / tutor / pcl61b.arj / PART6.EXE / MEMORY.TUT < prev    next >
Text File  |  1993-08-16  |  37KB  |  700 lines

  1.        
  2.        ---------------------------------------------------------------- 
  3.  
  4.                        UNDERSTANDING AND MANAGING MEMORY
  5.  
  6.        ---------------------------------------------------------------- 
  7.        
  8.        With so much information to absorb, a tutorial on the topic of 
  9.        computer memory seems dry and uninviting. Computer novices and 
  10.        advanced users alike might be tempted to sidestep the topic of 
  11.        computer memory. After all, if you just want to USE the computer 
  12.        to accomplish a task isn't it enough to know that data is stored 
  13.        in either RAM (random access memory) integrated circuit chips or 
  14.        on a disk drive and leave the troublesome details to the 
  15.        computer? Hardly... 
  16.        
  17.        If you want to get serious about configuring your computer for 
  18.        speed, be able to switch between several software programs 
  19.        quickly, troubleshoot mysterious software problems or optimize 
  20.        your computer for larger data processing tasks - learning to 
  21.        manage memory is an ESSENTIAL survival skill. The tricks and 
  22.        reference ideas presented in this tutorial make the difference 
  23.        between a computer that simply does the job and a computer that 
  24.        flies through piles of work. Later in this tutorial we will 
  25.        present some unusual "power user" tips to manage computer memory 
  26.        effectively. But first, let's step back, take a breath a pull 
  27.        together a few basic concepts from previous tutorials. 
  28.  
  29.        Computer memory is divided into two types. Disk storage which is 
  30.        long term storage. And RAM (random access memory) which is short 
  31.        term storage. RAM is only active as long as power is supplied to 
  32.        the computer. In a physical sense, RAM exists within small 
  33.        integrated circuit "chips" housed within the computer. 
  34.        
  35.        A byte is simply computer-speak for a character of information 
  36.        within a RAM chip memory area of the computer. Think of a byte 
  37.        as a small filing cabinet drawer in a busy office. The letter 
  38.        "A" occupies one byte of information. A kilobyte is roughly 
  39.        1,000 bytes of information. Actually it is 1,024 bytes or the 
  40.        number two multiplied to the eighth power since computers deal 
  41.        in binary math. A kilobyte is actually a small amount of storage 
  42.        space - perhaps a short business letter in size. A kilobyte can 
  43.        be written as 1K. A megabyte is a million bytes - 1M written in 
  44.        computer shorthand. These terms are frequently abbreviated as 
  45.        kilo (or K), mega (or M) and giga (or G). You may also see KB 
  46.        for kilobytes or MB or MEG for megabytes. 
  47.  
  48.        Some memory storage areas of the computer cannot be changed, 
  49.        however. ROM or read only memory is also held in special 
  50.        computer chips. These chips do not lose their information when 
  51.        power is removed. ROM chips contain special startup instructions 
  52.        used when the computer is first turned on as well as specific 
  53.        instructions such as how to use the disk drives and computer 
  54.        memory. ROM memory is fixed. RAM memory, however, is flexible 
  55.        and can be configured to suit different needs.
  56.  
  57.        To make things a little more interesting, RAM is available in 
  58.        two "flavors" or types. Dynamic RAM, sometimes abbreviated as 
  59.        DRAM which is relatively inexpensive and is the most common type 
  60.        of memory used in computers today. A second type, static RAM (or 
  61.        SRAM), is similar to DRAM but much faster in operation. Static 
  62.        RAM is usually configured for very fast "cache" memory which the 
  63.        central processor uses for temporary storage when DRAM would 
  64.        slow processing operations. Many computers do not contain SRAM 
  65.        and for the most part this tutorial deals with the management of 
  66.        dynamic RAM or DRAM; and this is where the majority of your data 
  67.        and software resides when the computer is operational. 
  68.  
  69.        To make the next jump in understanding we need to draw a map. 
  70.        Pay close attention, because understanding and managing this map of 
  71.        computer memory is where the secrets and tricks to boosting 
  72.        computer performance lie. We will dissect this map carefully in 
  73.        the paragraphs which follow... 
  74.        
  75.                   ------ A map of RAM computer memory ------
  76.  
  77.        
  78.          Conventional Memory       Upper Memory         Extended Memory
  79.                                              
  80.       0K                    640K                  1Meg                   
  81.       | ---------------------|--------------------|-------------------->
  82.        xxxx xxxxxxxxxxxxxxxxxx xxx xxx xxx xxx xxx xxx xxxxxxxxxxxxxxxxx       
  83.          |               |      |   |       |       |      | 
  84.          |               |      |   |       |       |      |
  85.          |               |    video | window for    | extended memory (XMS)
  86.        hardware code,    |          | expanded      | where software can
  87.        system data,      |          | memory (EMS)  | be relocated 
  88.        device drivers,   |          |               |  
  89.        memory resident   |      useful upper        |                   
  90.        programs          |      memory blocks       |      
  91.                          |      or UMB          high memory area
  92.                          |                      (HMA), the first
  93.                  free conventional              64K of extended
  94.                  memory: for programs           memory
  95.  
  96.        Tip: we will be referring to this map frequently so you might 
  97.        want a paper copy for frequent reference. Simply make sure the 
  98.        map is fully on your screen, turn on your printer and tap the 
  99.        Print-Screen key, sometimes abbreviated PrtSc or PrtScrn. If 
  100.        that does not work, try pressing the shift key (and hold it 
  101.        down) and then press the Print Screen key. Keep the map close by 
  102.        as our tutorial unfolds! 
  103.  
  104.        The above map of RAM memory looks technical and complex, but is 
  105.        actually quite simple. As we describe each section of the map, 
  106.        flip back and take a glance to refresh your "visual" 
  107.        understanding of this map. Once you understand this memory map 
  108.        you can "rearrange" how the DRAM memory of your computer is used 
  109.        for more effective, speedy computing! 
  110.  
  111.        The above map is analogous to a long wall of filing cabinet 
  112.        drawers. Each drawer can contain a computer piece or byte of 
  113.        information. Obviously, since we are dealing with millions of 
  114.        bytes this is a VERY long wall of filing cabinet drawers! Each 
  115.        filing cabinet has an address or location. The central processor 
  116.        in the computer also uses an addressing scheme to locate 
  117.        information in RAM memory. Note that the central processor in 
  118.        the computer can either read information from RAM or write 
  119.        information to RAM. RAM is somewhat like paper - it can store 
  120.        information. And the central processor holds a pencil and eraser 
  121.        so that it can read and write information as needed. 
  122.        
  123.        At the far left at 0K (zero thousand bytes of information) we 
  124.        notice that the RAM memory "filing cabinet drawers" store 
  125.        hardware code and system data including the MSDOS operating 
  126.        system itself. Normally device drivers and memory resident 
  127.        programs (TSR's) are stored in this area as well. 
  128.        
  129.        Moving to the right, next we see the free conventional memory 
  130.        where software such as a spreadsheet or word processor is held. 
  131.        This is the main memory area which concerns computer users and 
  132.        it is this area which can and should be maximized for effective 
  133.        computer use.
  134.        
  135.        Moving further to the right we see an important boundary exists 
  136.        at the memory location of 640K (640 kilobytes). It is here at 
  137.        the DOS 640K boundary that DOS does not normally allow a program 
  138.        to access further RAM memory. This is a design decision which 
  139.        was made when the first IBM desktop computer was manufactured 
  140.        and is based on the microprocessor selected at that time (8088 
  141.        CPU) and considerations of where to place video and disk drive 
  142.        memory access on those early machines. Although this 640K 
  143.        boundary was not meant to be crossed by software, clever memory 
  144.        management techniques will allow you to use RAM memory above the 
  145.        640K barrier. 
  146.        
  147.        Moving further to the right along the map we see the upper 
  148.        memory area which lies between 640K and 1 Meg. This memory is 
  149.        unique in that it is normally used to address hardware devices 
  150.        like your video monitor and disk controller which need a spot in 
  151.        memory to do their work. However some of this upper memory area 
  152.        can be reclaimed for other uses. One of the earlier schemes to 
  153.        reclaim this area was an memory management scheme called 
  154.        expanded memory sometimes abbreviated as EMS. 
  155.        
  156.        Finally, beyond the memory location at 1 Meg lies true extended 
  157.        memory which can be used for a variety of fascinating purposes - 
  158.        either actively by configuration of the user or passively by 
  159.        software which will detect and use expanded memory. Extended 
  160.        memory is abbreviated as XMS. Note that extended memory (XMS) 
  161.        can be installed in large amounts. A computer can have 2 Megs of 
  162.        memory, 4 Megs, 16 Megs and even more! The first 64K of extended 
  163.        memory is called the high memory area, sometimes abbreviated as 
  164.        HMA. 
  165.  
  166.        The secrets of memory management, then, lie outside or above the 
  167.        conventional 640K of RAM memory. Although 640K of conventional 
  168.        memory (640,000 bytes) sounds like a lot of RAM memory, today's 
  169.        advanced software uses memory voraciously! Let's pause for a 
  170.        moment and define the three specific types of memory seen above.
  171.  
  172.        CONVENTIONAL MEMORY. The first 640K of RAM memory. Conventional 
  173.        memory is used by applications software such as databases and 
  174.        word processors. It is sometimes called DOS memory. You can 
  175.        never have more than 640K of conventional memory due to the 
  176.        design of the original IBM PC. All PC clones share this 
  177.        conventional memory similarity. In order to use memory beyond 
  178.        640K you need to use special memory management software which is 
  179.        contained in later versions of DOS (versions 5.0 and 6.0) or a 
  180.        commercial or shareware memory management software package. 
  181.        Clever memory management can move some portions of DOS itself 
  182.        and the operating system out of conventional memory where it 
  183.        normally resided into upper or extended memory areas of RAM. 
  184.        This frees more conventional memory for use. Likewise, memory 
  185.        resident software programs and TSR's such as popup calendars, 
  186.        notepads and calculators can be moved out of conventional memory 
  187.        into upper or extended memory areas. 
  188.        
  189.        EXTENDED MEMORY. RAM memory which resides from the normal 1MB 
  190.        DOS limit to the top address limit of the CPU (central 
  191.        processing unit). This means to the top limit of the memory you 
  192.        have installed in the machine -  8 Megs of memory, for example. 
  193.        Using special software it is possible to convert extended memory 
  194.        to expanded memory. Extended memory is useful for software tasks 
  195.        like RAM disks, print buffers and other applications. Many 
  196.        software applications such as databases and spreadsheets can use 
  197.        extended memory for large tasks. Extended memory is also called 
  198.        XMS memory. 
  199.        
  200.        EXPANDED MEMORY. RAM memory which can be accessed only through a 
  201.        "window" or "page frame" set up inside the first 1 Megabyte of 
  202.        RAM. The usual limit of expanded memory is 32MB. Segments of 
  203.        this memory are quickly "paged in and out" of the memory window 
  204.        to create an illusion to the central processing chip of a large 
  205.        amount of memory - something like flipping the pages of a cartoon 
  206.        book to animate a story. Many applications such as spreadsheets 
  207.        and databases can use this memory to handle large tasks. 
  208.        Expanded memory is also called EMS memory. This type of memory 
  209.        is not commonly used today and was an early memory management 
  210.        standard. However, some software still supports this system. If 
  211.        you see references to LIM 3.0 or LIM 4.0 this is a clue that 
  212.        expanded memory can be used. Remember, extended memory can be 
  213.        converted to expanded memory using special software. Within DOS 
  214.        versions 5.0 and 6.0 a special software utility can make 
  215.        extended memory operate as expanded memory. This DOS utility is 
  216.        called EMM386 and only works on 80386 or higher central 
  217.        processors. Lotus, Intel and Microsoft Corporations (the letters 
  218.        of each company gave rise to the LIM specification) developed 
  219.        the early expanded memory management scheme when it was realized 
  220.        that early spreadsheets and other software needed more space 
  221.        than the existing 640K of conventional memory. 
  222.        
  223.        Of the two types, extended memory and expanded memory, today's 
  224.        software is usually configured to use extended memory if 
  225.        available. Even older XT computers, those using the 8088 
  226.        processor, can use expanded memory if an additional memory 
  227.        circuit board is installed. However XT class machines cannot use 
  228.        extended memory which is only available to machines using 80286, 
  229.        80386 and 80486 processors and their variants. 
  230.  
  231.        A concrete example to keep things simple. A customer might 
  232.        purchase a computer with 4 Megs or 4MB of memory. Of this, 640K 
  233.        is conventional memory. 384K is upper memory and the final 3M (3 
  234.        Megs) is extended memory. 
  235.  
  236.        Early XT class computers using the 8088 processor had only 640K 
  237.        of RAM or possibly 1 Meg of RAM. Users of AT class machines 
  238.        using the 80286 central processor frequently install between 2 
  239.        Megs and 4 Megs of RAM. Owners of computers housing 386, 386SX, 
  240.        486 or 486SX processors are able to access more than 16MB (16 
  241.        megabytes) of RAM. However, 4 to 8 Megs of RAM is considered a 
  242.        comfortable amount of memory on modern machines. A few "power 
  243.        users" may install 16 Megs or more of RAM memory. Note that XT 
  244.        computers using 8088 central processors cannot use extended 
  245.        memory. 
  246.  
  247.        Software programs that can run directly in extended memory are 
  248.        sometimes called DOS-extended programs. These types of programs 
  249.        can tell the central processor to switch to a special PROTECTED 
  250.        mode of operation for greater RAM memory access. Protected mode 
  251.        processors such as those based on the 80286, 80386 and 80486 can 
  252.        switch to protected mode to address greater amounts of memory. 
  253.        These processors switch from REAL mode into PROTECTED mode to 
  254.        address greater amounts of memory. The lowly 8088 processor used 
  255.        in the first IBM PC's operated only in REAL mode. Today many 
  256.        software programs use DOS extenders within their software code 
  257.        which allow computers to run in protected mode and thus address 
  258.        greater amounts of memory. 
  259.  
  260.        Although commercial software memory management utilities exist 
  261.        such as QEMM-386 and QRAM (from the Quarterdeck Company) and 
  262.        386MAX (from the Qualitas Company), DOS itself contains valuable 
  263.        software utilities to also accomplish the job. Note that users 
  264.        of DOS versions 5.0 and 6.0 have a variety of tools which can be 
  265.        used to configure memory for more efficient use. If you are not 
  266.        sure what version of DOS you have, simply type the DOS version 
  267.        command at the DOS prompt:    VER    <then press enter/return key>. 
  268.        DOS will tell you what version you are running. 
  269.        
  270.        The extended memory management utility program contained in DOS 
  271.        versions 5.0 and 6.0 is called HIMEM.SYS. It allocates and 
  272.        manages memory so that no two software programs try to use the 
  273.        same chunk of memory at the same time. A HIMEM.SYS statement is 
  274.        normally added to the CONFIG.SYS file which resides in the root 
  275.        directory of your hard drive. 
  276.  
  277.        Let's roll up our shirt sleeves and study HOW to manage memory. 
  278.        Be sure to glance at the memory map presented earlier in this 
  279.        tutorial to visualize what you are doing as this section of the 
  280.        tutorial progresses. Remember that many of these DOS commands 
  281.        and functions are ONLY found in DOS 5.0 and 6.0. Users of 
  282.        earlier versons of DOS can use special commercial and shareware 
  283.        utility software to emulate these functions if they do not own 
  284.        or wish to purchase DOS 5.0 or DOS 6.0.
  285.  
  286.        ---------------------------------------------------------------- 
  287.  
  288.                 THE DOS MEM COMMAND PRODUCES ESSENTIAL REPORTS
  289.  
  290.        ---------------------------------------------------------------- 
  291.           
  292.        If you are using DOS version 5.0 or 6.0 here is your first        
  293.        homework assignment. Use the MEM command to give you a report of 
  294.        the programs in memory, type of memory your machine contains and 
  295.        totals of each type of memory. At the DOS prompt type the 
  296.        command:     MEM /C    <then press enter/return key). A report 
  297.        will appear which contains useful information about the size and 
  298.        location of programs in memory. As you tinker with different 
  299.        configurations of memory run MEM /C from time to time to see how 
  300.        memory is used. Note that MEM actually has three command line 
  301.        switches of which MEM /C is the most useful. 
  302.        
  303.        If the report scrolls by too quickly use the DOS MORE command to 
  304.        slow it down. Type the following:   MEM /C|MORE 
  305.  
  306.        Want to print the report to paper? Try this:  MEM /C>PRN 
  307.        
  308.        Want the report printed to a small file for reading later? To 
  309.        create a report named CATFISH.TXT try this:  MEM /C>CATFISH.TXT     
  310.  
  311.        MEM syntax is:
  312.  
  313.        MEM [/CLASSIFY|/DEBUG|PROGRAM]
  314.  
  315.        Parameters:
  316.        
  317.        /CLASSIFY         Provide list of programs in conventional and 
  318.        or /C             upper memory
  319.        
  320.        /DEBUG            Provide list of programs and device drivers
  321.        or /D             loaded in memory
  322.        
  323.        /PROGRAM          Provide list of programs in memory
  324.        or /P
  325.  
  326.        The /C parameter switch is perhaps the most useful for 
  327.        determining contents of upper memory and may called from a batch 
  328.        file such as AUTOEXEC.BAT to confirm critical upper memory every 
  329.        time your machine is started!
  330.  
  331.        Be sure to run the MEM /C command from time to time as you 
  332.        tinker with memory. This is VITAL to achieving optimum memory 
  333.        configuration. 
  334.                 
  335.        ---------------------------------------------------------------- 
  336.  
  337.                   TINKERING WITH CONFIG.SYS AND AUTOEXEC.BAT
  338.  
  339.        ---------------------------------------------------------------- 
  340.        
  341.        The key to tinkering with memory is to rearrange the commands 
  342.        within two files usually stored within the root directory of 
  343.        your hard drive. These special configuration and start up files 
  344.        are CONFIG.SYS and AUTOEXEC.BAT. They are discussed in the 
  345.        advanced DOS tutorial and the batch file tutorial in a earlier 
  346.        section of PC-Learn so you might want to read those two 
  347.        tutorials a second time to brush up a bit before proceeding. 
  348.        
  349.        To change the commands and statements within CONFIG.SYS and 
  350.        AUTOEXEC.BAT we need a text editor or word processor - DOS 
  351.        versions 5.0 and 6.0 provides a simple editor called EDIT.COM. 
  352.        To load a file named CONFIG.SYS into the editor simply type the 
  353.        command:   EDIT CONFIG.SYS. For hard drive users, since 
  354.        CONFIG.SYS usually resides in the root directory of the hard 
  355.        drive, the command might instead be EDIT C:\CONFIG.SYS. Then you 
  356.        can change and rearrange statements in the file. When you are 
  357.        done tinkering simply use the editor to save the file back to 
  358.        disk in the newly revised version. 
  359.        
  360.        Be SURE to save a spare copy of both CONFIG.SYS and AUTOEXEC.BAT 
  361.        on a spare floppy disk just in case your tinkering leaves your 
  362.        machine operating poorly. If necessary you can then reboot the 
  363.        computer from a fresh copy of DOS on floppy disk and then recopy 
  364.        the old versions of CONFIG.SYS and AUTOEXEC.BAT back to the hard 
  365.        drive root directory. If you are using your word processor to 
  366.        affect changes in CONFIG.SYS or AUTOEXEC.BAT be sure to save the 
  367.        file in pure ASCII format and not WordPerfect or Microsoft Word 
  368.        format! 
  369.  
  370.        Let's get to work...
  371.  
  372.        Assuming you have a computer with 80286, 80386 or 80486 processor 
  373.        and MORE than 1 Meg of RAM memory you can load DOS itself into 
  374.        the high memory area. You must be running DOS 5.0 or 6.0 to use 
  375.        this trick. Add the following two lines as the FIRST two 
  376.        statements of your CONFIG.SYS file:
  377.  
  378.        C:\DOS\HIMEM.SYS
  379.        DOS=HIGH
  380.  
  381.        When you have done this, reboot your computer to let the revised 
  382.        CONFIG.SYS take charge! Test available memory by running the test 
  383.        utility    MEM /C.
  384.  
  385.        HIMEM.SYS is the high memory manager of DOS. The two lines given 
  386.        above must be placed as the FIRST lines before other upper 
  387.        memory mangers or statements within the CONFIG.SYS file (for 
  388.        example, before EMM386.EXE is loaded). The command DOS=HIGH 
  389.        tells DOS to load itself in the high memory area. 
  390.            
  391.        ---------------------------------------------------------------- 
  392.  
  393.                           LET'S TINKER WITH THE UMA
  394.  
  395.        ---------------------------------------------------------------- 
  396.        
  397.        Memory resident programs, also called TSR's (terminate and stay 
  398.        resident software) can also be moved out of conventional memory 
  399.        into the UMA (upper memory area) of extended memory. This is 
  400.        done by using the software utility found in DOS 5.0 and 6.0 
  401.        called EMM386.EXE. Note that EMM386.EXE will ONLY work on 80386 
  402.        and 80486 computers (as well as their close cousins, the 80386SX 
  403.        and 80486SX computers). 
  404.  
  405.        We will add another line or so to the CONFIG.SYS file to 
  406.        accomplish this. Note that you can add several parameters to the 
  407.        EMM386 command. The command has several variations. For example, 
  408.        you might want to tell EMM386 to NOT create expanded memory from 
  409.        extended memory. This is done by inserting the following command 
  410.        in the CONFIG.SYS file and then rebooting the computer:
  411.  
  412.        DEVICE=C:\DOS\EMM386.EXE NOEMS
  413.  
  414.        Note the word "NOEMS" which sets the computer so that extended 
  415.        memory is NOT used for expanded memory. However, if you want to 
  416.        convert 2 MB of extended memory to expanded memory and also want 
  417.        EMM386 to manage DOS programs in extended memory add this 
  418.        command to CONFIG.SYS:
  419.  
  420.        DEVICE= C:\DOS\EMM386.EXE RAM 2048
  421.        
  422.        ---------------------------------------------------------------- 
  423.  
  424.                  LET'S LOAD TSR'S AND DEVICE DRIVERS INTO UMA
  425.  
  426.        ---------------------------------------------------------------- 
  427.        
  428.        Let's load device drivers and TSR programs into the upper memory 
  429.        area (UMA). First, run the MEM /C command and study the report. 
  430.        Find the entry marked "largest available upper memory block". 
  431.        Next determine the size of the largest device driver listed in 
  432.        the conventional memory list that could fit into this vacant 
  433.        space in memory. Let's say that somewhere in your CONFIG.SYS you 
  434.        are using the device driver ANSI.SYS which is currently loaded 
  435.        into the conventional memory area. To send it into the upper 
  436.        memory area CHANGE this command in CONFIG.SYS: 
  437.  
  438.        DEVICE=C:\DOS\ANSI.SYS               
  439.        
  440.        to this new command:
  441.  
  442.        DEVICEHIGH=C:\DOS\ANSI.SYS
  443.  
  444.        Reboot the computer, run the MEM /C command and study the 
  445.        result. As you locate areas in upper memory which are free, try 
  446.        to tuck device drivers such as ANSI.SYS and others into upper 
  447.        memory by modifying the     DEVICE=     statement into the
  448.                                DEVICEHIGH=     statement.
  449.  
  450.        Device drivers such as DOSKEY, GRAPHICS, and MOUSE drivers can 
  451.        all be loaded into upper memory using this tip!
  452.  
  453.        You further modify this technique by adding the following 
  454.        statement to the DOS=HIGH command that we placed in CONFIG.SYS. 
  455.        
  456.        Instead of seeing this statement:          DOS=HIGH      
  457.        
  458.        We would see this statement:               DOS=HIGH,UMB
  459.        
  460.        This modification tells DOS that programs are loaded into the 
  461.        upper memory blocks (programs such as the mouse driver or 
  462.        ANSI.SYS, that we discussed) and that DOS should maintain a sort 
  463.        of "memory link" to them. If you forget to add this switch 
  464.        (,UMB) then DOS will load the devices high into upper memory but 
  465.        will NOT be able to operate them since it does not know they 
  466.        have been relocated. 
  467.  
  468.        Be sure to use the MEM /C command from time to time to see how 
  469.        you are doing on memory optimization. Be sure to reboot (or 
  470.        restart) the computer each time you make a modification to see 
  471.        the results. 
  472.  
  473.        Next, a curve ball! The above method works for device drivers 
  474.        (like the mouse driver or ANSI.SYS), but what can be done if you 
  475.        want to load a memory resident TSR program (terminate and stay 
  476.        resident or popup program) into upper memory? Instead of the 
  477.        DEVICEHIGH=   command inside the CONFIG.SYS file, use a 
  478.        different command: LOADHIGH. But be careful! The LOADHIGH 
  479.        command is used ONLY in the AUTOEXEC.BAT file, NOT in the 
  480.        CONFIG.SYS file. For example, a computer user might be running 
  481.        the TSR program DOSKEY which is a useful macro processor found 
  482.        in DOS versions 5.0 and 6.0. Instead of this command in the 
  483.        AUTOEXEC.BAT:    DOSKEY    the following memory efficient 
  484.        command might be used in AUTOEXEC.BAT:   LOADHIGH DOSKEY 
  485.        
  486.        ---------------------------------------------------------------- 
  487.  
  488.                     BEFORE AND AFTER OPTIMIZATION: EXAMPLES
  489.  
  490.        ---------------------------------------------------------------- 
  491.        
  492.        Sometimes it is helpful to study actual examples of memory 
  493.        optimization. With that in mind, listed below are some sample 
  494.        CONFIG.SYS and AUTOEXEC.BAT files both before and after memory 
  495.        optimization. Remember that these two files normally reside in 
  496.        the root directory of your hard drive    C:\   Be sure to save 
  497.        your original files on floppy in case you your tinkering 
  498.        produces unworkable results. 
  499.  
  500.        CONFIG.SYS  (BEFORE OPTIMIZATION)
  501.        
  502.        DEVICE=C:\DOS\ANSI.SYS
  503.        FILES=20
  504.        BUFFERS=30,8
  505.  
  506.        CONFIG.SYS  (AFTER OPTIMIZATION)
  507.  
  508.        DEVICE=C:DOS\HIMEM.SYS
  509.        DOS=HIGH,UMB
  510.        DEVICE=C:\DOS\EMM386.EXE NOEMS
  511.        DEVICE=C:DOS\SMARTDRV.SYS 1024 2048
  512.        DEVICEHIGH=C:\DOS\ANSI.SYS
  513.        FILES=20
  514.        BUFFERS=30,8
  515.        
  516.  
  517.        AUTOEXEC.BAT  (BEFORE OPTIMIZATION)
  518.        
  519.        PROMPT $p$g
  520.        PATH C:\;C:\DOS;\C:\GAMES
  521.        C:\DOS\DOSKEY.COM
  522.        C:\DOS\MOUSE
  523.        
  524.        AUTOEXEC.BAT  (AFTER OPTIMIZATION)
  525.  
  526.        PROMPT $p$g
  527.        PATH C:\;C:\DOS;\C:\GAMES
  528.        LOADHIGH C:\DOS\DOSKEY.COM
  529.        LOADHIGH C:\DOS\MOUSE
  530.        
  531.        ---------------------------------------------------------------- 
  532.  
  533.                                  MORE EXAMPLES
  534.  
  535.        ---------------------------------------------------------------- 
  536.        
  537.        Here is a typical minimal CONFIG.SYS for a 80286 computer having 
  538.        only 1 Meg of memory:
  539.  
  540.        DEVICE=C:DOS\HIMEM.SYS
  541.        DOS=HIGH
  542.        DEVICE=C:\DOS\SMARTDRV.SYS 256 128
  543.        FILES=20
  544.        BUFFERS=4
  545.        STACKS=0,0
  546.        
  547.        The first line loads the memory manager HIMEM.SYS which works 
  548.        only with 80286, 80386 or 80486 machines. Line two loads DOS 
  549.        into high memory. Line three loads the hard disk cache which 
  550.        comes with DOS, SMARTDRV. 256 is the maximum size for the disk 
  551.        cache and 128 is the minimum size. If only one number is given 
  552.        this is automatically the maximum size for the cache. The next 
  553.        line means that up to 20 DOS files can be open at one time. The 
  554.        next line referring to buffers allocates memory for data to be 
  555.        retrieved from the disk drive. Buffers can probably be decreased 
  556.        since SMARTDRV.SYS performs many of the same functions as 
  557.        buffers and is faster. The final statement referring to STACKS 
  558.        allows even more memory to be squeezed from the machine. Most 
  559.        programs should run fine with STACKS=0,0 but if some programs 
  560.        lock up you can remove this line. Any references to EMM386.EXE 
  561.        are omitted from this CONFIG.SYS because 80286 based machines 
  562.        cannot use that utility.
  563.  
  564.        Next, a typical CONFIG.SYS for a more powerful 80386 or 80486 
  565.        machine.
  566.        
  567.        DEVICE=C:DOS\HIMEM.SYS
  568.        DOS=HIGH,UMB
  569.        DEVICE=C:\DOS\EMM386.EXE NOEMS
  570.        DEVICEHIGH=C:\DOS\SMARTDRV.SYS 256 128
  571.        FILES=20
  572.        BUFFERS=4
  573.        STACKS=0,0
  574.  
  575.        The interesting differences here are that the EMM386 memory 
  576.        manager is loaded including the ,UMB switch. Also the DEVICEHIGH 
  577.        statement is used to load SMARTDRV.SYS driver high.
  578.        
  579.        If you have a 80386 or 80486 machine with at least two megabytes 
  580.        of memory or more you can increase the SMARTDRV.SYS statement 
  581.        from this:        SMARTDRV.SYS 256 128
  582.        to this:          SMARTDRV.SYS 1024 256
  583.        This increases the size and performance of the SMARTDRV system 
  584.        which your hard drive uses.
  585.  
  586.        Conversely, if you run Windows 3.1 and have trouble running in 
  587.        a higher mode you might change SMARTDRV.SYS to this:  
  588.        SMARTDRV.SYS 128
  589.  
  590.        ---------------------------------------------------------------- 
  591.  
  592.                                 POWER USER TIPS
  593.  
  594.        ---------------------------------------------------------------- 
  595.  
  596.        If you are not using DOS 5.0 or 6.0 and are interested in upper 
  597.        memory and extended memory management, you can buy commercial 
  598.        or shareware programs to accomplish the same goal. Contact the 
  599.        shareware vendors listed elsewhere in PC-Learn (see the SOFTWARE 
  600.        RESOURCES tutorial). Two popular shareware memory managers are 
  601.        the DOS 5.0 Memory Kit and The Last Byte Memory Manager which 
  602.        are available from many shareware disk vendors. Commercial 
  603.        software memory management utilities are QEMM-386 and QRAM (from 
  604.        the Quarterdeck Company) and 386MAX (from the Qualitas Company). 
  605.        The last two should be available from most retail software 
  606.        outlets. 
  607.  
  608.        Novice DOS 6.0 users can use the sophisticated MEMMAKER utility 
  609.        to automatically configure the CONFIG.SYS and AUTOEXEC.BAT 
  610.        files! For more information regarding MEMAKER and additional 
  611.        DOS 6.0 memory configuration refinements, read the DOS 6.0 
  612.        tutorial elesewhere within PC-Learn and also review the MEMMAKER 
  613.        notes which can be accessed via the DOS 6.0 HELP facility. 
  614.        Simply type the following DOS command at the DOS prompt: 
  615.        HELP MEMMAKER    <then press enter/return key> 
  616.  
  617.        Using another clever memory management scheme, DOS 6.0 also 
  618.        gives users the option to select from a menu of various 
  619.        CONFIG.SYS and AUTOEXEC.BAT files upon startup. Users can thus 
  620.        start the comptuer in the morning with a memory configuration 
  621.        optimized for Windows and later in the day restart the computer 
  622.        and select a menu option with memory reconfigured and optimized 
  623.        for a DOS database program. Read the DOS 6.0 tutorial elsewhere 
  624.        in PC-learn and study the "multiple configuration option." This 
  625.        option is also discussed in the DOS 6.0 HELP facility. Type the 
  626.        following command at the DOS prompt: 
  627.        HELP MULTI-CONFIG     <then press enter/return key> 
  628.  
  629.        The LOADHIGH statement, used in the AUTOEXEC.BAT file, can be 
  630.        abbreviated to LH if you prefer. LOADHIGH works on only 80386 or 
  631.        80486 machines. 
  632.  
  633.        80286 computers can use the DOS=HIGH command to load DOS into 
  634.        HIGH memory and free more conventional memory for applications.
  635.               
  636.        Never try to relocate HIMEM.SYS or EMM.EXE into the UMA using 
  637.        the DEVICEHIGH command! These programs MUST reside in 
  638.        conventional memory! 
  639.  
  640.        Load HIMEM.SYS before EMM386.EXE. 
  641.  
  642.        Always add the ,UMB switch  to the DOS=HIGH command BEFORE you 
  643.        load device drivers and TSR (memory resident programs) into the 
  644.        UMA. 
  645.  
  646.        Don't try to use EMM386.EXE on 8088, 8086 or 80286 computers. 
  647.               
  648.        Always load the proprietary device driver required by your own 
  649.        EMS (expanded memory board) and all device drivers that use 
  650.        extended memory BEFORE you load EMM386.EXE and immediately AFTER 
  651.        loading HIMEM.SYS and do NOT try to use EMM386.EXE to simulate 
  652.        EMS (expanded memory) if another expanded memory manager is 
  653.        already present. 
  654.  
  655.        Sometimes a software program may use its own internal memory 
  656.        manager or DOS extender. If a program works fine before you use 
  657.        EMM386.EXE and fails after installing EMM386.EXE, contact the 
  658.        program's manufacturer. You may need an update to your 
  659.        spreadsheet or database package so that it is compatible with 
  660.        EMM386.EXE. 
  661.  
  662.        If you use Windows 3.0 which contains older versions of 
  663.        EMM386.EXE and HIMEM.SYS programs, delete those versions and use 
  664.        the newer versions which come with DOS 5.0 or 6.0. 
  665.  
  666.        When using DOS 5.0 or 6.0 memory management tricks, remember 
  667.        that EMS (expanded memory) managers use a small portion of UMA 
  668.        which resides between 640K and 1 Meg for the EMS page frame. 
  669.        This page frame memory requirement of EMS memory produces a 
  670.        smaller amount of UMA memory for DOS to relocate device drivers 
  671.        and TSR memory resident programs. Thus if you do not need EMS 
  672.        memory DO NOT load or configure it! Usually spreadsheets are the 
  673.        most frequent candidates for expanded memory - most other 
  674.        software applications can use extended memory.
  675.  
  676.        If you are trying to load memory resident TSR programs into high 
  677.        memory remember these tips:
  678.  
  679.        You must have at least 350K of extended memory, and the 
  680.        CONFIG.SYS file should contain the statement DEVICE=HIMEM.SYS  
  681.        which must appear prior to any other DEVICE commands. The 
  682.        CONFIG.SYS file must also contain either one of these 
  683.        statements: DOS=UMB or DOS=HIGH. Further, CONFIG.SYS should also 
  684.        contain a DEVICE=statement for EMM386.EXE which includes one of 
  685.        these two switches: /NOEMS  or   /RAM   and EMM386.EXE command 
  686.        must appear after the HIMEM.SYS statement but prior to any 
  687.        DEVICEHIGH statements. Finally, a DEVICEHIGH statement must be 
  688.        available for each device driver which is to be loaded into 
  689.        upper memory and the AUTOEXEC.BAT file must contain a LOADHIGH 
  690.        statement for each memory resident program to be run in upper 
  691.        memory. 
  692.        
  693.        Tutorial finished. Have you registered PC-Learn to receive your 
  694.        bonus disks? Registration is encouraged. Shareware works on the 
  695.        honor system! Send $25 to Seattle Scientific Photography, 
  696.        Department PCL6, PO Box 1506, Mercer Island, WA 98040. Latest 
  697.        version of PC-Learn and two bonus disks shipped promptly! 
  698.  
  699.  
  700.